﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FtpVideoChoice.ascx.cs" Inherits="JohnnySins.Controls.FtpVideoChoice" %>

<script type="text/javascript">
    $(function () {
        $("#ftpVideoChoice").dialog({ autoOpen: false, width: 640, minHeight: 480, resizable: false });
        $("#ftpVideoChoice").parent().appendTo(jQuery("form:first"));
        $(".ui-dialog-titlebar").hide();
    });

    function createFtpVideoChoiceForm(id) {
        __doPostBack('<%= upVideoChoice.ClientID %>', id);
    }

    function showFtpVideoChoice() {
        var wWidth = $(window).width();
        var wHeight = $(window).height();
        var dlgWidth = 970;
        var dlgHeigth = wHeight * 80 / 100;

        var dlg = $("#ftpVideoChoice");
        dlg.dialog("option", "width", dlgWidth);
        dlg.dialog("option", "height", dlgHeigth);
        dlg.dialog('open');
    }
</script>

<div id="ftpVideoChoice">
    <asp:UpdatePanel runat="server" ID="upVideoChoice" OnLoad="upVideoChoice_Load" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:GridView ID="grid" AutoGenerateColumns="false" runat="server" CssClass="table table-bordered table-hover" AllowPaging="False">
                <Columns>
                    <asp:TemplateField HeaderText="File Name">
                        <ItemTemplate>
                            <a href='javascript:void(0)' onclick="javascript:CustomFileUpload_SelectFile('<%# Container.DataItem %>', '<%= hdFuId.Value %>'); $('#ftpVideoChoice').dialog('close');"><%# Container.DataItem %></a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <div class="button_group">
                    <input type="button" class="btn btn-info" value="Close" onclick="$('#ftpVideoChoice').dialog('close'); return false;" />
            </div>

            <asp:HiddenField runat="server" ID="hdFuId" />
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
